package com.syh.jn.scm.infrastructure.repository.model.finance;

import com.syh.core.ddd.infrastructure.repository.model.SuperBusinessModel;
import lombok.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 收入单
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity
@Table(name = "T_FINANCE_INCOME_BILL")
@EqualsAndHashCode(callSuper = true)
public class IncomeBillModel extends SuperBusinessModel {
  /**
   * 收入单编号
   */
  @Column(name = "CODE", columnDefinition = "varchar(50) COMMENT '收入单编号'")
  private String code;
  /**
   * 客户类型: 0上游, 1下游, 2物流
   */
  @Column(name = "CUSTOMER_TYPE", columnDefinition = "smallint COMMENT '客户类型: 0上游, 1下游, 2物流'")
  private Short customerType;
  /**
   * 客户id
   */
  @Column(name = "CUSTOMER_ID", columnDefinition = "bigint COMMENT '客户id'")
  private Long customerId;
  /**
   * 收入单状态:0待确认, 1已确认, 3已生成账单, -1已取消
   */
  @Column(name = "STATE", columnDefinition = "smallint COMMENT '收入单状态:0待确认, 1已确认, 3已生成账单, -1已取消'")
  private Short state;
  /**
   * 对账单id
   */
  @Column(name = "STATEMENT_OF_ACCOUNT_ID", columnDefinition = "bigint COMMENT '对账单id'")
  private Long statementOfAccountId;
  /**
   * 录单人id
   */
  @Column(name = "BROKERAGE_ID", columnDefinition = "bigint COMMENT '录单人id'")
  private Long brokerageId;
  /**
   * 录单日期
   */
  @Column(name="INPUT_TIMESTAMP" , columnDefinition=("bigint COMMENT '录单日期'"))
  private Long inputTimestamp;
  /**
   * 收入金额
   */
  @Column(name = "PRICE", columnDefinition = "decimal(19,2) COMMENT '收入金额'")
  private BigDecimal price;
  /**
   * 备注
   */
  @Column(name = "REMARK", columnDefinition = "varchar(100) COMMENT '备注'")
  private String remark;
  /**
   * 对方确认生效状态：0未生效, 1已生效
   */
  @Column(name = "CONFIRM_STATE", columnDefinition = "smallint COMMENT '对方确认生效状态:0未生效, 1已生效'")
  private Short confirmState;
  /**
   * 我方单据图片
   */
  @Column(name = "MAIN_SRC_IMAGES", columnDefinition = "varchar(1000) COMMENT '我方单据图片'")
  private String mainSrcImages;
  /**
   * 对方单据图片
   */
  @Column(name = "SECOND_SRC_IMAGES", columnDefinition = "varchar(1000) COMMENT '对方单据图片'")
  private String secondSrcImages;
  /**
   * 创建日期
   */
  @Column(name = "CREATE_TIME_STAMP", columnDefinition = "bigint COMMENT '创建日期'")
  private Long createTimeStamp;
  /**
   * 最后修改日期
   */
  @Column(name = "LAST_UPDATE_TIME_STAMP", columnDefinition = "bigint COMMENT '最后修改日期'")
  private Long lastUpdateTimeStamp;
}
